import { INTEGER_PG } from "~/db.pg";
import { KeyAccumulatable } from "~/search";

/** 期望进行哪种数字计算 */
export enum ArithType {
  SUMMARY,
  COUNT,
}

/** 对某个 key 进行计算的请求 */
export type Arith<T> = {
  key: KeyAccumulatable<T>;
  type: ArithType;
};

/** 对某个 key 进行计算得到的结果 */
export type ArithResult<T> = Arith<T> & {
  value: INTEGER_PG;
};
